<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title>拒绝巡检计划</title>
	<t:base type="jquery,easyui,tools,DatePicker"></t:base>
	<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
	<script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
	<script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.min.js"></script>
</head>
<body style="overflow:hidden;" scroll="no">
<t:formvalid formid="assignEngineer" action="zyInspectionPlanController.do?doBatchRefuseMissionOfAreaEngineer" dialog="true" usePlugin="password" layout="table" tiptype="3" beforeSubmit="beforeSubmit">
	<input type="hidden" value="${planIds }" name="planIds" id="planIds"/>
	<input type="hidden" name="fileId" id="fileId"/>
	<table>
		<tr>
			<td style="width: 60px;">
				<label>拒绝原因:</label>
			</td>
			<td>
				<textarea name="remark" style="width: 410px;height: 170px;" datatype="*" nullmsg="填写拒绝原因"></textarea>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">附件：</label>
			</td>
			<td colspan="3" class="value">
				<input type="button" value="上传附件" id="remarkFileUpload1" onclick="jiaoyan()"/>
				<span id="fileUploadname">
						${name}
				</span>
			</td>
		</tr>
	</table>
</t:formvalid>
</body>
<script type="text/javascript">
    $(function(){
        //var planIds = $("#planIds").val();

        $("#remarkFileUpload1").uploadify({
            buttonText : '上传文件',
            auto : true,
            progressData : 'speed',
            multi : true,
            height : 20,
            width : 60,
            overrideEvents : ['onDialogClose'],
            fileTypeDesc : '文件格式:',
            queueID : 'instructionfile',
            fileTypeExts : '*.*',
            fileSizeLimit : '15MB',
            swf : 'plug-in/uploadify/uploadify.swf',
            uploader : 'zyInspectionPlanController.do?remarkFileUploadView',
            onUploadSuccess : function(file,data) {
                var json = $.parseJSON(data).attributes;
                $("#fileUploadname").text(json.name);
               // alert("附件2id="+json.fileKey);
                $("#fileId").val(json.fileKey);
//                $("#code").val(json.code);
                tip("上传成功！");
            },onFallback : function(){
                tip("您未安装FLASH控件，无法上传文件！请安装FLASH控件后再试");
            },onSelectError : function(file, errorCode, errorMsg){
                switch(errorCode) {
                    case -100:
                        tip("上传的文件数量已经超出系统限制的"+$('#instruction').uploadify('settings','queueSizeLimit')+"个文件！");
                        break;
                    case -110:
                        tip("文件 ["+file.name+"] 大小超出系统限制的"+$('#instruction').uploadify('settings','fileSizeLimit')+"大小！");
                        break;
                    case -120:
                        tip("文件 ["+file.name+"] 大小异常！");
                        break;
                    case -130:
                        tip("文件 ["+file.name+"] 类型不正确！");
                        break;
                };
            }
        });
    });
function beforeSubmit(){
	var flag = true;
	$.ajax({
		url : "zyInspectionPlanController.do?doJudgeForAreaEngineerAssignEngineer",
		data : {
			"planIds" : $("#planIds").val(),
			"type" : "1",
		},
		cache : false,
		dataType : 'json',
		type : 'POST',
		async : false,
		success : function(data){
			if(!data.success){
				flag = false;
				tip(data.msg);
			}
		}
	});
	return flag;
}
</script>